﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace Game.DataLoading
{
    public class ContentLoader
    {

        private static ContentLoader loaderInstance;
        private static ContentManager Content;

        private ContentManager mContent;

        private ContentLoader(ContentManager pContent) 
        {
            mContent = pContent;
        }

        public static ContentLoader Instance
        {
            get
            {
                if (loaderInstance == null)
                {
                    loaderInstance = new ContentLoader(Content);
                }
                return loaderInstance;
            }
        }

        public static void Initialize(ContentManager pContent)
        {
            Content = pContent;
        }

        /**
         * Data loading methods
         */

        public Texture2D LoadTexture(string TextureName)
        {
            return mContent.Load<Texture2D>(TextureName);
        }

    }
}
